import request from '@/utils/request'
// 获取组织架构
export const getDepartment = () => request({
  url: '/company/department'
})

// 删除部门
export const delDepartments = id => request({
  url: `/company/department/${id}`,
  method: 'delete'

})

// 新增部门
export const addDepartments = data => request({
  url: '/company/department',
  method: 'post',
  data
})
// 根据id获取详情
export function getDepartDetail(id) {
  return request({
    url: `/company/department/${id}`
  })
}
// 编辑部门
export function updateDepartments(data) {
  return request({
    url: `/company/department/${data.id}`,
    //  get post put delete
    method: 'put',
    data
  })
}
